Developer Documentation

QuickTime 4 API Documentation

Inside Macintosh: More Macintosh Toolbox

Previous | Chapter Top | Chapter Contents | Next |

Calling Other Components

The Component Manager provides two techniques that allow a component to call other components. First, your component may invoke the services of another component using the standard mechanisms also used by applications. The Component Manager then passes the requests to the appropriate component, and your component receives the results of those requests.

Second, your component may supplement its capabilities by using the services of another component to directly satisfy application requests. The Component Manager provides the DelegateComponentCall function, which allows your component to pass a request to a specified component. For example, you might want to create two similar components that provide different levels of service to applications. Rather than completely implementing both components, you could design one to rely on the capabilities of the other. In this manner, you have to implement only that portion of the more capable component that provides additional services.

DelegateComponentCall

The DelegateComponentCall function provides an efficient mechanism for passing on requests to a specified component. Your component must open a connection to the component to which the requests are to be passed. Your component must close that connection when it has finished using the services of the other component.

The DelegateComponentCall function does not accept a component identifier in place of a component instance. In addition, your component should never use the DelegateComponentCall function with open or close requests from the Component Manager--always use the OpenComponent and CloseComponent functions to manage connections with other components.

FUNCTION DelegateComponentCall
                                         (originalParams: ComponentParameters;
                                          ci: ComponentInstance): LongInt;
originalParams
The component parameters record provided to your component by the Component Manager.
ci
The component instance that is to process the request. The Component Manager provides a component instance to your component when it opens a connection to another component with the OpenComponent or OpenDefaultComponent function. You must specify a component instance; this function does not accept a component identifier.

DESCRIPTION

The DelegateComponentCall function calls the component instance specified by the ci parameter, and passes it the specified component parameters record. DelegateComponentCall returns a long integer containing the component result returned by the specified component.

SEE ALSO

See "The Component Parameters Record" for a description of the component parameters record. See OpenDefaultComponent , OpenComponent , and CloseComponent , respectively, for information on the OpenDefaultComponent , OpenComponent , and CloseComponent functions.

See Listing 16 for an example of the use of the DelegateComponentCall function.


© 1999 Apple Computer, Inc.

Previous | Chapter Top | Chapter Contents | Next